<template>
  <!-- 下拉刷新
         1：refresh刷新
               完成相应数据处理
               让v-model的值变成false
  -->
  <div>
    <div class="box">
      <van-pull-refresh v-model="loading" @refresh="refresh">
        <div v-for="(item, index) in 30" :key="index">
          123---刷新了:{{ num }}次
        </div>
      </van-pull-refresh>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      loading: false,
      num: 10
    }
  },
  methods: {
    refresh () {
      setTimeout(() => {
        this.num++
        this.loading = false
      }, 2000)
    }
  }
}
</script>
<style>
.box {
  width: 300px;
  height: 200px;
  border: 5px solid #ccc;
  overflow: auto;
}
</style>
